import { Tree } from "antd";
import {useComponentsStore} from "../../stores/components.tsx";


export function Outline() {
    const { components, setCurrentComponent } = useComponentsStore();

    return <Tree
        fieldNames={{ title: 'desc', key: 'id' }}
        treeData={components as any}
        showLine
        defaultExpandAll
        onSelect={([selectedKey]) => {
            setCurrentComponent(selectedKey as number);
        }}
    />
}
